import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/app',
      name: '',
      component: () => import('@/views/layout/index.vue'),
      redirect: '/app/index',
      children: [
        {
          path: 'index',
          name: 'index',
          component: () => import('@/views/index/index.vue')
        },
        {
          path: 'class',
          name: 'class',
          component: () => import('@/views/class/index.vue')
        },
        {
          path: 'person',
          name: 'person',
          component: () => import('@/views/personnel/index.vue')
        },
        {
          path: 'dept',
          name: 'dept',
          component: () => import('@/views/dept/index.vue')
        }
      ]
    }
  ]
})

export default router